package com.livepan.server.service;

import com.livepan.server.error.BusinessException;
import com.livepan.server.service.model.SubmissionModel;

import java.io.IOException;
import java.util.List;
import java.util.Set;

public interface SubmissionService {
    //查询符合条件的提交的列表
    List<SubmissionModel> querySubmissionList(String userId, Integer problemId, Short language, Integer contestId,
                                              Integer status, Integer offset, Integer limit);

    //查询符合条件的提交的列表的总个数
    Integer querySubmissionCount(String userId, Integer problemId, Short language, Integer contestId,
                                 Integer status);

    //根据runId，查询提交的信息
    SubmissionModel getSubmissionById(Integer runId);

    //创建一个提交记录
    SubmissionModel createSubmission(SubmissionModel submissionModel) throws BusinessException;

    SubmissionModel updateSubmission(SubmissionModel submissionModel);

    //得到一场考试的所有的提交
    List<SubmissionModel> getContestSubmission(Integer contestId, String userId) throws BusinessException;


    Set<Integer> getSubmitProblemIDList(String userId, Integer status);

    //重新评测指定的题目的提交
    void reJudge(Integer contestId,String userId,  Integer problemId) throws IOException;

    //重测指定的提交
    void reJudge(Integer submissionId) throws IOException;
}
